<!DOCTYPE html>
<html lang="zh-CN">

    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'" />
        <title>验证</title>
		<style>
			.mmc-modal{
				width: 100%;
				height: 100%;
				display: none;
				flex-direction: column;
			}
			.mmc-modal-content{
				display: flex;
				flex-direction: column;
				align-items: center;
				border: 1px solid #c0c4cc;
				border-radius: 5px;
				padding: 30px 0;
				margin: 20px 30px;
				box-shadow: 0 1px 1px 0 #c0c4cc, 0 1px 1px 0 #c0c4cc;
			}
			.mmc-modal-input-lay{
				margin-top: 5px;
				font-size: 14px;
			}
			.mmc-modal-btn-lay{
				margin-top: 10px;
			}
		</style>
    </head>

    <body>
        <noscript>
            <strong>Please enable JavaScript to continue.</strong>
        </noscript>
        <div id="app"></div>
		
		<div id="mcModal" class="mmc-modal">
			<div class="mmc-modal-content">
				<div class="mmc-modal-input-lay">
					账号：<input type="text" name="un" id="mcun" />
				</div>
				<div class="mmc-modal-input-lay">
					密码：<input type="password" name="pw" id="mcpw" >
				</div>
				<div class="mmc-modal-btn-lay">
					<input type="button" value="确定" id="mcLogin" />
				</div>
			</div>
		</div>
    </body>


	<script>
		function showMcModal(un){
			let mcModalDiv = document.getElementById('mcModal');
			let btn = document.getElementById("mcLogin");
			btn.onclick = function(){
				alert('准备调用扫一扫');
				window.onScan = function(str){
					alert(str);
					window.onScan = () => {str};
					resolve(str);
				};
				try{
					demo.callPhone('15086921298');
				}catch(e){
					alert('插件异常');
					alert(e);
					alert(JSON.stringify(e));
				}
			};
			mcModalDiv.style.display = 'flex';
		}
		showMcModal();
	</script>
</html>